package com.tencent.system.listener;

import com.tencent.system.service.IPermissionService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;
import javax.servlet.annotation.WebListener;

@WebListener
public class PermissionScanInitListener implements ServletContextListener {
    @Autowired
    private IPermissionService permissionService;

    //spring容器初始化结束之后被调用
    @Override
    public void contextInitialized(ServletContextEvent servletContextEvent) {
        System.out.println("扫描权限注解开始");
        permissionService.scanPermission();
        System.out.println("扫描权限注解结束");
    }
}
